from numpy import nan as NaN
import pandas as pd
import numpy as np

series_01 = pd.Series([4, NaN, 8, NaN, 5])
print(series_01)
print(series_01.dropna())
df_01 = pd.DataFrame([[1, 2, 3], [NaN, NaN, 2], [NaN, NaN, NaN], [8, 8, NaN]])
print(df_01)
print(df_01.dropna(how="all"))
print(df_01.dropna(axis=1, how="all"))
print(df_01.fillna({0: 10.0, 1: 20.0, 2: 30.0}))
print(df_01.iloc[:, 1].fillna(5, inplace=False))
df_02 = pd.DataFrame(np.random.randint(0, 10, (5, 5)))
df_02.iloc[1:4, 3] = NaN
df_02.iloc[2:4, 4] = NaN
print(df_02)
print(df_02.fillna(method="ffill"))
print(df_02.fillna(method="bfill", limit=1))
